<template>
    <div class="header_container" :class="bgColor">
        <div class="header_container_item_left"></div>
        <div class="header_container_item_middle">学习记事本</div>
        <div class="header_container_item_right">
            <van-icon name="discount" @click="show" />
        </div>
      <van-popup class="prop" v-model="isShow" position="left" :style="{ height:'100%', width: '40%' }" >
          <van-button color="red" @click="changeColor('red')">red</van-button>
          <van-button color="yellow" @click="changeColor('yellow')">yellow</van-button>
          <van-button color="skyblue" @click="changeColor('skyblue')">skyblue</van-button>
          <van-button color="green" @click="changeColor('green')">green</van-button>
          <van-button color="purple" @click="changeColor('purple')">purple</van-button>
          <van-button color="linear-gradient(to right, #ff6034, #ee0a24)" @click="goSearch">搜索</van-button>
      </van-popup>
    </div>
</template>

<script>
export default {
    data(){
        return{
            isShow:false,
            bgColor:"",
        }
    },
    methods:{
        show(){
            this.isShow = !this.isShow
        },
        changeColor(el){
            this.bgColor = el
        },
        goSearch(){
            this.$router.push('/about')
        }
    }
}
</script>

<style scoped>
.header_container
{
    display: inline-flex;
    justify-content: space-between;
    padding: 0 20px;box-sizing: border-box;
    width: 100vw;
    height: 64px;
    background-color: #334256;

}

.header_container_item_left,.header_container_item_middle,.header_container_item_right
{
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.header_container_item_left
{
    width: 20%;
}

.header_container_item_middle
{
    width: 60%;
    font-size: 25px;
    font-weight: bold;
    color: aliceblue;
}

.header_container_item_right
{
    width: 20%;
    color: aliceblue;
    font-size: 25px;
}

.prop
{
    display: inline-flex;
    /* justify-content: center; */
    padding: 0 10px;
    box-sizing: border-box;
    flex-direction: column;

}

.prop .van-button
{
   width: 90%;
   margin-top: 20px; 
}

.red{
    background-color: red;
}

.skyblue{
    background-color: skyblue;
}

.yellow{
    background-color: yellow;
}

.green{
    background-color: green;
}

.purple{
    background-color: purple;
}
</style>